<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- rel="stylesheet" 这个不能少，否则页面无法加载css文件 -->
    <!--    <link href="../frm/sweetalert2/css/sweetalert2.css" rel="stylesheet" type="text/css"></link>-->
    <link href="../frm/sweetalert2/css/dark/dark.css" rel="stylesheet" type="text/css"></link>
    <style>

    </style>

</head>
<body>
<div id="app">
    <button @click="ck">OK</button>
</div>
<script src="../frm/sweetalert2/js/sweetalert2.js"></script>
<script src="../frm/vue.js"></script>
<script src="../frm/vue-router.js"></script>

<script type="module">

    new Vue({
        el: "#app",
        beforeCreate() {
          Vue.prototype.$bus = this;
          this.$bus.$on("hello",d=>{
              console.log("bus OK",d);
          });
        },
        beforeDestroy() {
            this.$bus.$off("hello");
        },
        methods: {
            ck(){
                this.$emit("hello","data0");
            }
        },
    });


</script>

</body>
</html>
